#!/usr/bin/env python

import sys
import bsddb

if __name__ == "__main__":
    db_fname = sys.argv[1]
    db = bsddb.btopen(db_fname, 'r')

    if len(sys.argv) > 2:
        keys = sys.argv[2:]
    else:
        keys = db.keys()

    for key in keys:
        print '%s\t%s' % (key, db[key])

